<div id="page-wrapper">
  <div class="row">
    <div class="col-lg-12">
      <h1>Категории</h1>
      <ol class="breadcrumb">
        <li><a href="<?php echo url::site('admin/categories')?>"><i class="icon-book"></i> Категории</a></li>
      </ol>
      <a href="<?php echo url::site('admin/categories/create')?>" class="btn btn-primary btn-lg" type="button">Создать категорий</a>
      <table class="table table-bordered table-hover table-striped tablesorter" style="margin-top: 20px">
        <thead>
          <tr>
            <th>ID <i class="fa fa-sort"></i></th>
            <th>Название <i class="fa fa-sort"></i></th>
            <th>Описание</th>
            <th>Родительская категоря</th>
            <th>Опции............. </th>
          </tr>
        </thead>

        <tbody>
          <?php foreach ($categories as $category):?>
          <tr class="active">
            <td><?php echo $category->id?></td>
            <td><?php echo $category->title?></td>
            <td><?php echo Text::limit_words($category->description, 20)?></td>
            <td><?php echo ORM::factory('Category', $category->parent_id)->title?></td>
            <td> <a href="<?php echo url::site('admin/categories/edit/' . $category->id)?>">редак.</a> | <a href="<?php echo url::site('admin/categories/delete/' . $category->id)?>">удал.</a></td>
          </tr>
          <?php endforeach?>
        </tbody>
      </table>
    </div>
  </div>
</div>